import qs from 'qs'
//获取用户组件
import req from "@/utils/request";

export default {
  pluginsLiberCount (query) {
    return req({
      url: "/api/pluginsLiberCount",
      method: "get",
      params: query,
    });
  },
  /**
   * 根据应用ID查找设置数据
   * @param query
   */
  getAppDataByAppId (query) {
    return req({
      url: "/api/getAppDataByAppId",
      method: "get",
      params: query,
    });
  },
  /**
   * 应用函数头组件数据配置
   * @param query
   */
  addAppliseSourceFunctionConfig (query) {
    return req({
      url: "/api/addAppliseSourceFunctionConfig",
      method: "post",
      data: query,
      datat: 'json',
      headers: {
        'Content-Type': 'application/json'
      }
    });
  },
  /**
   * 应用连线信息详情
   * @param query
   */
  appliesInfo (query) {
    return req({
      url: "/api/getAppliesInfo",
      method: "get",
      params: query,
    });
  },
  /**
   * 上传组件文件
   * @param formData
   */
  uploadPluginsFile (formData) {
    return req({
      url: "/api/addPluginsFile",
      method: "put",
      data: formData
    });
  },
  /**
   * 上传环境文件
   * @param formData
   */
  uploadRequireFile (formData) {
    return req({
      url: "/api/addRequireFile",
      method: "put",
      data: formData
    });
  },
  /**
   * 新增组件
   * @param query
   */
  pluginsAdd (query) {
    return req({
      url: "/api/pluginsAdd",
      method: "put",
      data: query,
      datat: 'json',
      headers: {
        'Content-Type': 'application/json'
      }
    });
  },
  /**
   * 获取源配置信息
   * @param query
   */
  getAppAqueueByAppId (query) {
    return req({
      url: "/api/getAppAqueueByAppId",
      method: "get",
      params: query
    });
  },
  /**
   * 上传应用环境文件
   * @param formData
   */
  editPARequireFile (formData) {
    return req({
      url: "/api/editPARequireFile",
      method: "post",
      data: formData,
      datat: 'form'
    });
  },
  /**
   * 应用日志
   * @param query
   */
  getAppRunLog (query) {
    return req({
      url: "/api/getAppRunLog",
      method: "get",
      params: query
    });
  },
  /**
   * 应用日志
   * @param query
   */
  appliesControlRun (query) {
    return req({
      url: "/api/appliesControlRun",
      method: "get",
      params: query
    });
  },
  /**
   * 公告列表
   * @param query
   */
  getNoticeListByPage (query) {
    return req({
      url: "/api/getNoticeListByPage",
      method: "get",
      params: query
    });
  },
  /**
   * 公告新增
   * @data data
   */
  addNotice (data) {
    return req({
      url: "/api/addNotice",
      method: "post",
      data: data
    });
  },
  /**
   * 公告修改
   * @data data
   */
  editNotice (data) {
    return req({
      url: "/api/editNotice",
      method: "put",
      data: qs.stringify(data),
      datat: 'form'
    });
  },
  /**
   * 公告修改
   * @data data
   */
  delNotice (data) {
    return req({
      url: "/api/delNotice",
      method: "delete",
      params: data
    });
  },
  /**
   * 组件库列表
   * @data data
   */
  getPLibrary (data) {
    return req({
      url: "/api/getPLibrary",
      method: "get",
      params: data
    });
  },
  /**
   * 组件库新增
   * @data data
   */
  addPLibrary (data) {
    return req({
      url: "/api/addPLibrary",
      method: "put",
      data: qs.stringify(data),
      datat: 'form'
    });
  },
  /**
   * 组件库更新
   * @data data
   */
  updatePLibrary (data) {
    return req({
      url: "/api/updatePLibrary",
      method: "post",
      data: qs.stringify(data),
      datat: 'form'
    });
  },
  /**
   * 组件库删除
   * @data data
   */
  deletePLibrary (data) {
    return req({
      url: "/api/deletePLibrary",
      method: "delete",
      params: data
    });
  },
  /**
   * 组件类型列表
   * @data data
   */
  getPclassListByPage (data) {
    return req({
      url: "/api/getPclassListByPage",
      method: "get",
      params: data
    });
  },
  /**
   * 组件参数类型新增
   * @data data
   */
  addPClass (data) {
    return req({
      url: "/api/addPClass",
      method: "get",
      params: data
    });
  },
  /**
   * 组件参数类型修改
   * @data data
   */
  editPClass (data) {
    return req({
      url: "/api/editPClass",
      method: "get",
      params: data
    });
  },
  /**
   * 组件参数类型修改
   * @data data
   */
  delPClass (data) {
    return req({
      url: "/api/delPClass",
      method: "delete",
      params: data
    });
  },
  /**
   * 资源组列表
   * @data data
   */
  getRGroupListByPage (data) {
    return req({
      url: "/api/getRGroupListByPage",
      method: "get",
      params: data
    });
  },
  /**
   * 资源组新增
   * @data data
   */
  addRGroup (data) {
    return req({
      url: "/api/addRGroup",
      method: "post",
      data: qs.stringify(data),
      datat: 'form'
    });
  },
  /**
   * 资源组修改
   * @data data
   */
  editRGroup (data) {
    return req({
      url: "/api/editRGroup",
      method: "put",
      data: qs.stringify(data),
      datat: 'form'
    });
  },
  /**
   * 资源组删除
   * @data data
   */
  delRGroup (data) {
    return req({
      url: "/api/delRGroup",
      method: "delete",
      params: data
    });
  },
  /**
   * 新增结构设置信息
   * @data data
   */
  addPStructure (data) {
    return req({
      url: "/api/addPStructure",
      method: "put",
      data: data,
      datat: 'json',
      headers: {
        'Content-Type': 'application/json'
      }
    });
  },
  
  /**
   * 登陆用户组件列
   * @data data
   */
  getPluginsByUserPage (data) {
    return req({
      url: "/api/getPluginsByUserPage",
      method: "get",
      params: data
    });
  },
  /**
   * 根据条件获取所有任务列表
   * @data data
   */
  getRuningTasks (data) {
    return req({
      url: "/api/getRuningTasks",
      method: "get",
      params: data
    });
  },
  /**
   * 应用暂停运行
   * @data data
   */
  pauseTask (data) {
    return req({
      url: "/api/pauseTask",
      method: "get",
      params: data
    });
  },
  /**
   * 应用恢复运行
   * @data data
   */
  recoverTask (data) {
    return req({
      url: "/api/recoverTask",
      method: "get",
      params: data
    });
  },
  /**
   * 应用恢复运行
   * @data data
   */
  stopRunTask (data) {
    return req({
      url: "/api/stopRunTask",
      method: "get",
      params: data
    });
  },
  /**
   * 应用运行 item.appType === 2
   * @data data
   */
  appliesRunSingle (data) {
    return req({
      url: "/api/appliesRunSingle",
      method: "get",
      params: data
    });
  },
  
  
}